#include "pcf8591.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
extern "C" {
    #include <unistd.h>
    #include <fcntl.h>
    #include <sys/types.h>
    #include <sys/ioctl.h>
    #include <linux/types.h>
    #include <linux/i2c.h>
    #include <linux/i2c-dev.h>
}

pcf8591::pcf8591(QObject *parent,char *filename,unsigned char dev_addr,unsigned char ch) : i2c_dev(parent,filename,dev_addr)
{
    this->ch = ch;
}

int pcf8591::read_data(unsigned char ctl_b, unsigned char *buf, unsigned char len)
{
    return this->i2c_read(ctl_b,buf,len);
}
